// 1.引入状态管理器模块
import { createStore } from 'redux'

// 2.创建reducer
const reducer = (state = {
  list: [1, 2, 3]
}, action) => {
  const { type, payload } = action
  switch (type) {
    case "CHANGE_LIST":
      return Object.assign({}, state, { list: payload })
    default:
      return state
  }
}

// 3.创建状态管理器
const store = createStore(reducer)

// 4.暴露状态管理器
export default store